package com.example.administrator.pomelostreet.fragment;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.administrator.pomelostreet.HttpUtils.HttpUtil;
import com.example.administrator.pomelostreet.R;
import com.youth.banner.Banner;

import static android.R.attr.fragment;

/**
 * A simple {@link Fragment} subclass.
 */
public class ShoeBagFragment extends Fragment {
    int index;
    int pager;


    public ShoeBagFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment

        View view= inflater.inflate(R.layout.fragment_shoe_bag, container, false);
        return view;


    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview_shoe_bag);
        SwipeRefreshLayout swipeRefresh = (SwipeRefreshLayout) view.findViewById(R.id.swipeRefresh_shoe_bag);

//        int index = getArguments().getInt("index");
//
//        getfragment();

    }

    public void getfragment() {
        switch (index){
            case 1:
                mRefreshing();

                break;
            case 2:

                break;
            case 3:

                break;
            case 4:

                break;
            case 5:

                break;


        }


    }

    private void mRefreshing() {
        final String path="http://api.youzibuy.com/brand_area_catalog/item_list?myuid=131221329&tbuid=&device_id=02:00:00:00:00:00&platform=android&v=1.3.2&imei=861483030821249&bundleid=8&mode=0&app_id=7&v_auth=3.fWJkjCzxIALWJiD2lAHhMaTg3eE%252BIe9NMjEkL%252FM7Tpw%253D&sdkversion=23&catalog_id=0&group_id="+index+"&page="+pager+"&size=0  ";
        new Thread(){
            @Override
            public void run() {
                byte[] dataUseOkHttp = HttpUtil.getDataUseOkHttp(path);
                String str=new String(dataUseOkHttp);


            }
        }.start();




    }
}
